import { styled } from "styled-components";

interface IProps {
  isplay: number,
  isloop: number,
  volume: number,
}

export const PlayerBarWrapper = styled.div<IProps>`
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 64px;
  background-color: var(--color-navbar-bg);
  backdrop-filter: saturate(180%) blur(30px);

  .ant-slider {
    margin: 0px;

    .ant-slider-handle {
      width: 6px;
      height: 6px;
    }

    .ant-slider-rail {
      background-color: rgba(0, 0, 0, 0.6);
    }
  }

  .playerbar-content {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    ${props => props.theme.mixin.wrapv1}
    height: 100%;


    .song-info {
      flex: 1;
      height: 100%;
      display: flex;
      font-weight: 600;
      color: #fff;

      .song-cover {
        width: 46px;
        height: 46px;
        border-radius: 4px;
      }

      .trank-info {
        display: flex;
        height: 46px;
        margin-left: 12px;
        flex-direction: column;
        justify-content: center;

        .name {
          opacity: .8;
          font-size: 16px;
          margin-bottom: 4px;
          cursor: pointer;

          &:hover {
            text-decoration: underline;
          }
        }

        .artist {
          font-size: 12px;
          cursor: pointer;
          opacity: .58;

          &:hover {
            text-decoration: underline;
          }
        }
      }
    }

    .middle-control-buttons {
      flex: 1;
      display: flex;
      align-content: center;
      justify-content: center;

      .btn {
        width: 28px;
        height: 28px;
        margin: 0 8px;
        padding: 8px;
      }

      .prev {
        background-position: 0 -130px;

         &:hover {
          background-position: -30px -130px;
        }
      }

      .play {
        width: 36px;
        height: 36px;
        position: relative;
        top: -5px;
        background-position: ${props => props.isplay ? "-0px -165px" : "-0px -204px;"};

        &:hover {
          background-position: ${props => props.isplay ? "-40px -165px" : "-40px -204px"}
        }
      }
      
      .next {
        background-position: -80px -130px;

         &:hover {
          background-position: -110px -130px;
        }
      }
    }

    .right-control-buttons {
      flex: 1;
      display: flex;
      align-items: center;
      justify-content: flex-end;

      .playlist {
        width: 48px;
        height: 28px;
        border-radius: 50%;
        background-position: -42px -68px;

        &:hover {
          background-position: -42px -98px;
        }
      }

      .loop {
        width: 25px;
        height: 25px;
        margin: 0 12px;
        /* 0.顺序播放 1.随机 2.循环 */
        ${(props) => {
    switch (props.isloop) {
      case 0:
        return "background-position: -3px -344px;"
      case 1:
        return "background-position: -66px -248px;"
      case 2:
        return "background-position: -93px -344px;"
    }
  }}
      }

      .volume-control {
        display: flex;
        align-items: center;
        width: 120px;

        .volume-icon {
          width: 25px;
          height: 25px;
          margin-right: 5px;
          background-position: ${props => props.volume ? "-2px -248px" : "-104px -69px "};

           &:hover {
            background-position: ${props => props.volume ? "-31px -248px;" : "-126px -69px; "}
          }
        }

        .ant-slider-horizontal {
          flex: 1;
        }

        .ant-slider-track {
          background-color: #fff;
          opacity: .9;
        }

        .ant-slider-handle::after {
          box-shadow: none;
        }
      }
    }

    .arraw-up {
      padding: 6px;
      margin: 0 12px;
      border-radius: 6px;

      &:hover {
        background-color: rgba(255, 255, 255, 0.2);
      }

      img {
        width: 24px;
        height: 24px;
      }
    }
  }

  
`